package com.soulless.pattern1;

/**
 * 课程工厂
 * <p>
 *
 * </p>
 *
 * @author zenglei
 * @date 2023/5/29 15:46
 */
public class CourseFactory {

    public ICourse create(Class<? extends ICourse> clazz) {
        if (null != clazz) {
            try {
                return clazz.newInstance();
            } catch (InstantiationException e) {
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
        }

        return null;
    }

}
